import {createRouter, createWebHistory} from 'vue-router';

const routes = [
    {
        path: '/',
        redirect: '/index',
        children: [
            {
                path: '/index',
                component: () => import('@/views/index/index.vue')
            },
            {
                path: '/entity/generate',
                component: () => import('@/views/code/GenerateEntity.vue')
            },
            {
                path: '/entity/config',
                component: () => import('@/views/code/EntityConfig.vue')
            },
            {
                path: '/database/config',
                component: () => import('@/views/code/DataBaseConfig.vue')
            }
        ]
    },
    // 其他路由配置
    {
        path: '/:pathMatch(.*)',
        component: () => import('@/views/error/404.vue')
    }
];

const router = createRouter({
    history: createWebHistory(),
    routes
});

export default router;
